set color to bg+/b
@  10,1 clea to 23,78
OKA=.f.
DO WHILE .not. OKA .AND. LASTKEY()<>27
**   HOMADD=HOM_ADD
**   HOMCITY=HOM_CITY
**   HOMCOUNT=HOM_COUNT
**   HCOUNTRY=HOM_COUNT

     HOMTEL=HOM_TEL

** split the ADD1 field into two: Apt No/ Addr1
   LOCAPTNO=SUBSTR(LOC_ADD1,1,8)
   LOCADD1=SUBSTR(LOC_ADD1,9,24)
*
   LOCADD2=LOC_ADD2
   LOCCITY=LOC_CITY
   LOCTEL=LOC_TEL
   HOMTEL=HOM_TEL
      IF LASTKEY()=27
         RETURN
      ENDIF

** 12/05/2000 - Start - Dickson
**    remove the redudant Home Address entries so that the cashier has less  
**    fields to enter for the Patient's address

**      do boxen with 10,1,"Address :",'homadd','BG+','B','W+','N',40
**      do boxen with 10,54,"City :",'homCITY','BG+','B','W+','N',14
**      do boxt with 12,1,"Country :",'BG+','B',.F.,.F.
**      do natioMOD
**      SELE 1
**      IF HOMCOUNT<>HCOUNTRY
**          STORE SPACE(32) TO LOCADD1
**          STORE SPACE(40) TO LOCADD2
**          STORE SPACE(16) TO LOCCITY
**          STORE SPACE(14) TO LOCTEL
**      ENDIF

**      set color to bg+/b
**      @  12,1 clea to 23,78
**      do boxt with 12,1,"Country : "+homcount,'BG+','B',.F.,.F.
**      do boxen with 12,32,"Tel. :",'homTEL','BG+','B','W+','N',14
**      IF left(HOMCOUNT,5)<>SUBS(AEACOUN,1,5)

        LOCAPTNO=SUBSTR(LOC_ADD1,1,8)
        LOCADD1=SUBSTR(LOC_ADD1,9,24)

**         LOCADD1 = LOC_ADD1
         LOCADD2 = LOC_ADD2
**Buu - Email address 24/6/03
	   EMAIL_ADD=EMAIL
	   ARCH_CL = ARCH_C
	   ARCH_DT = ARCH_D
**Buu - Email End 24/6/03
         LOCCITY = LOC_CITY
         LOCTEL  = LOC_TEL
         HOMTEL  = HOM_TEL

         DO BOXT     WITH  10,1,"Address in "+alltrim(AEACOUN),'BG+','B',.F.,.F.

         DO BOXT     WITH 12,1,"No/Apartment No   : "+LOCAPTNO,'BG+','B',.F.,.F. 
         DO BOXT     WITH 14,1,"Address (line 1)  : "+LOCADD1,'BG+','B',.F.,.F. 
         DO BOXT     WITH 16,1,"Address (line 2)  : "+LOCADD2,'BG+','B',.F.,.F. 
         DO BOXT     WITH 18,1,"City      : "+LOCCITY,'BG+','B',.F.,.F. 
**Buu - Email address 24/6/03
         DO BOXT WITH 20,1,"Email:"+EMAIL_ADD,'BG+','B',.F.,.F. 
**Buu - Email End 24/6/03

** Buu - Archive for clinic 31/7/2003
         DO BOXT WITH 12,50,"Archive Clinic :"+ARCH_CL,'BG+','B',.F.,.F.
         DO BOXT WITH 14,50,"Archive Dental :"+ARCH_DT,'BG+','B',.F.,.F.
** Buu- End 31/7/2003

         DO BOXT     WITH 18,48,"Tel.1: "+LOCtel,'BG+','B',.F.,.F.
         DO BOXT     WITH 20,48,"Tel.2: "+HOMtel,'BG+','B',.F.,.F.
         DO BOXEN WITH 12,1,"No/Apartment No   :",'LOCAPTNO','BG+','B','W+','N',8
         DO BOXENNOE WITH 14,1,"Address (line 1)  :",'LOCADD1','BG+','B','W+','N',24
         DO BOXEN WITH 16,1,"Address (line 2)  :",'LOCADD2','BG+','B','W+','N',40 

**Buu - Email address 24/6/03
         DO BOXEN WITH 20,1,"Email:",'EMAIL_ADD','BG+','B','W+','N',40 
**Buu - Email End 24/6/03

** Buu - Archive for clinic 31/7/2003
         DO BOXEN WITH 12,50,"Archive Clinic :",'ARCH_CL','BG+','B','W+','N',8
         DO BOXEN WITH 14,50,"Archive Dental :",'ARCH_DT','BG+','B','W+','N',8
** Buu- End 31/7/2003

**  -------------
         ly1=savescreen(0,0,24,79)                                                                                                                                                                                                                        
         store space(16) to uCity
         DO WHILE uCity=SPACE(16)
            DO CITY
            IF LASTKEY()=27
               uCity = LOCCity
               SET COLOR TO BG+/B                                                                                                                                                                                                                         
            else
               if lastkey() = 13
                  LOCCity = uCity
               endif
            ENDIF                                                                                                                                                                                                                                         
         ENDDO                                                                                                                                                                                                                                            
         restscreen(0,0,24,79,ly1)                                                                                                                                                                                                                        
         SET COLOR TO BG+/B                                                                                                                                                                                                                               

         SELECT 1  
         DO BOXT     WITH 18,1,"City      : "+LOCCITY,'BG+','B',.F.,.F. 
         DO BOXEN  WITH 18,48,"Tel.1:",'LOCtel','BG+','B','W+','N',14


** Start Dickson - 26-7-01 - requested by Anita/Tany to include a 2nd Tel# (make use of the HOM_TEL field)
         DO BOXEN  WITH 20,48,"Tel.2:",'HOMTel','BG+','B','W+','N',14

** End Dickson - 26-7-01
**
*         DO BOXEN WITH 14,1,"Address in "+alltrim(AEACOUN)+" :",'LOCADD1','BG+','B','W+','N',32
*         DO BOXEN WITH 16,1,"Number and Street :",'LOCADD2','BG+','B','W+','N',40
*         DO BOXEN WITH 18,1,"City :",'LOCcity','BG+','B','W+','N',14
*         DO BOXEN WITH 18,32,"Tel. :",'LOCtel','BG+','B','W+','N',14

**      ENDIF

      PL7=1
      DO BOX2 WITH 21,3,"DO YOU WANT TO ",'CONFIRM','CANCEL','gr+','r','gR+','B',PL7,.f.,.T.
      do case
      case PL7=1
         OKa=.t.
      case pl7=2 .OR. LASTKEY()=27
         OKa=.f.
      endcase
ENDDO
IF OKA
   IF REC_LOCK(0)
**12/05/2000 - start - Dickson
**      REPL HOM_ADD  WITH HOMADD,HOM_CITY WITH HOMCITY,HOM_COUNT WITH HOMCOUNT,HOM_TEL WITH HOMTEL
** 12/05/2000 - end
      REPL LOC_CITY WITH LOCCITY,LOC_TEL WITH LOCTEL,LOC_ADD1 WITH LOCAPTNO+LOCADD1,LOC_ADD2 WITH LOCADD2, HOM_TEL with HOMTEL
** Buu-Email address 24/6/03
	REPL EMAIL with EMAIL_ADD
	REPL ARCH_C with ARCH_CL
	REPL ARCH_D with ARCH_DT
** Buu-End Email 24/60/03
   ENDIF
   UNLOCK
ENDIF
RETURN

